/*    */ package cn.zzuisa.news.convertor;
/*    */ 
/*    */ import cn.zzuisa.news.DTO.CommentDTO;
/*    */ import cn.zzuisa.news.entity.Comment;
/*    */ import cn.zzuisa.news.repository.UserRepository;
/*    */ import cn.zzuisa.news.repository.dao.UserDAO;
/*    */ import java.util.List;
/*    */ import java.util.stream.Collectors;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class Comment2CommentDTO
/*    */ {
/* 21 */   public static UserRepository userDAO = new UserDAO();
/*    */ 
/*    */   
/*    */   public static CommentDTO convert(Comment comment) {
/* 25 */     CommentDTO commentDTO = new CommentDTO();
/* 26 */     commentDTO.setContent(comment.getContent());
/* 27 */     commentDTO.setId(comment.getId());
/* 28 */     commentDTO.setUser(userDAO.findById(comment.getuId()));
/* 29 */     commentDTO.setCreatetime(comment.getCreatetime());
/* 30 */     return commentDTO;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/* 38 */   public static List<CommentDTO> convert(List<Comment> comments) { return (List)comments.stream().map(e -> convert(e)).collect(Collectors.toList()); }
/*    */ }


/* Location:              /Users/frank/Desktop/admin/WEB-INF/classes/!/cn/zzuisa/news/convertor/Comment2CommentDTO.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */